package com.gp.service.calculate;

/**
*@date: 2017年11月28日
*@author: 弓成龙
*@email: gcx909109@sina.cn
*@description:计算核心模块抽象层
**/
public abstract class CalculateProcessor {
  
  // 需要计算的数据
  private CalculateData calculateData;
  
  // 计算数据的规则
  private CalculateRule calculateRule;
  
  /**
   * 加载数据和规则
   */
  public void loadDataAndRule(AbstarctDataAndRuleFactory model){
    this.setCalculateData(model.loadCalculateData());
    this.setCalculateRule(model.loadCalculateRule());
  }
  
  /**
   * 实现计算的方法 
   */
  public abstract void calculate();

  public CalculateData getCalculateData() {
    return calculateData;
  }

  public void setCalculateData(CalculateData calculateData) {
    this.calculateData = calculateData;
  }

  public CalculateRule getCalculateRule() {
    return calculateRule;
  }

  public void setCalculateRule(CalculateRule calculateRule) {
    this.calculateRule = calculateRule;
  }
  
}
